extension ListExtension<T> on List<T> {
  /// containsWhere
  bool containsWhere(bool Function(T element) test) {
    for (var element in this) {
      if (test(element)) {
        return true;
      }
    }
    return false;
  }

  List<T> filter(bool Function(T element) test) {
    List<T> result = [];
    for (var element in this) {
      if (test(element)) {
        result.add(element);
      }
    }
    return result;
  }
}